﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EYangFramework.Common.Ninject
{
    public class NinjectProvider
    {
        //单例模式,保证全局获取到的注入器都是同一个
        private static NinjectCore ninjectCore;
        private static object obj = new object();
        public static NinjectCore NinjectCore
        {
            get {
                if (ninjectCore == null)
                {
                    lock (obj)
                    {
                        if (ninjectCore == null)
                        {
                            ninjectCore = new NinjectCore();
                        }
                    }
                }
                return ninjectCore;
            }
        }
    }
}
